import 'dart:io';

class MyHttpOverrides extends HttpOverrides {
  @override
  HttpClient createHttpClient(SecurityContext? context) {
    var http = super.createHttpClient(context);
    //TODO 使用时替换成代理IP
    http.findProxy = (uri) {
      // return 'PROXY localhost:8888';
      return 'PROXY 172.31.128.1:9999';
    };
    http.badCertificateCallback =
        (X509Certificate cert, String host, int port) => true;
    return http;
  }
}
